package com.learn.bus.data;

import com.learn.bus.AbstractData;
import com.learn.bus.Data;

import java.time.LocalDateTime;

/**
 * <p>项目名称: design-pattern </p>
 *
 * <p>文件名称: StatusData </p>
 *
 * An event raised when applications starts/stops, containing the start/stops time of the application.
 */
public class StatusData extends AbstractData {

    private final LocalDateTime when;
    private final String detail;

    public StatusData(LocalDateTime when, String detail) {
        this.when = when;
        this.detail = detail;
    }

    public LocalDateTime getWhen() {
        return when;
    }

    public String getDetail() {
        return detail;
    }

    public static Data of(LocalDateTime when, String detail){
        return new StatusData(when, detail);
    }

}
